import React, { Component } from 'react';
import Swiper from './ui/Swiper';
import connect from './connect'
import Search from './ui/Search'
import Hotcate from './ui/Hotcate'
import List from '@/components/List'
import Header from '@/components/Header';


@connect
class index extends Component {
    componentDidMount() {
        // 轮播图
        this.props.initSwiper()

        // 热门分类
        this.props.getHotCateData()

        // 精品好菜 
        this.props.getGoodCookbookData()
    }
    render() {
        return (
            <>
                {/* 顶部导航 */}
                <Header />

                {/* 顶部轮播图 */}
                <Swiper />

                {/* 搜索 */}
                <Search />

                {/* 热门分类 */}
                <Hotcate />

                {/* 精品好菜 */}
                <List data={this.props.goodcookbook} />
            </>
        );
    }
}

export default index;
